package com.ruoyi.ftrl.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ftrl.mapper.ControlRecordsMapper;
import com.ruoyi.ftrl.domain.ControlRecords;
import com.ruoyi.ftrl.service.IControlRecordsService;

/**
 * 温控阀操控日志Service业务层处理
 * 
 * @author dihang
 * @date 2024-08-16
 */
@Service
public class ControlRecordsServiceImpl implements IControlRecordsService 
{
    @Autowired
    private ControlRecordsMapper controlRecordsMapper;

    /**
     * 查询温控阀操控日志
     * 
     * @param id 温控阀操控日志主键
     * @return 温控阀操控日志
     */
    @Override
    public ControlRecords selectControlRecordsById(Long id)
    {
        return controlRecordsMapper.selectControlRecordsById(id);
    }

    /**
     * 查询温控阀操控日志列表
     * 
     * @param controlRecords 温控阀操控日志
     * @return 温控阀操控日志
     */
    @Override
    public List<ControlRecords> selectControlRecordsList(ControlRecords controlRecords)
    {
        return controlRecordsMapper.selectControlRecordsList(controlRecords);
    }

    /**
     * 新增温控阀操控日志
     * 
     * @param controlRecords 温控阀操控日志
     * @return 结果
     */
    @Override
    public int insertControlRecords(ControlRecords controlRecords)
    {
        controlRecords.setCreateTime(DateUtils.getNowDate());
        return controlRecordsMapper.insertControlRecords(controlRecords);
    }

    /**
     * 修改温控阀操控日志
     * 
     * @param controlRecords 温控阀操控日志
     * @return 结果
     */
    @Override
    public int updateControlRecords(ControlRecords controlRecords)
    {
        controlRecords.setUpdateTime(DateUtils.getNowDate());
        return controlRecordsMapper.updateControlRecords(controlRecords);
    }

    /**
     * 批量删除温控阀操控日志
     * 
     * @param ids 需要删除的温控阀操控日志主键
     * @return 结果
     */
    @Override
    public int deleteControlRecordsByIds(Long[] ids)
    {
        return controlRecordsMapper.deleteControlRecordsByIds(ids);
    }

    /**
     * 删除温控阀操控日志信息
     * 
     * @param id 温控阀操控日志主键
     * @return 结果
     */
    @Override
    public int deleteControlRecordsById(Long id)
    {
        return controlRecordsMapper.deleteControlRecordsById(id);
    }

    @Override
    public List<ControlRecords> selectControlRecordsByUserId(Long userId) {
        return controlRecordsMapper.selectControlRecordsByUserId(userId);
    }
}
